package com.xjoyt.pay.master.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.xjoyt.pay.vo.PayType;

/**
 * 渠道商费率
 * 
 * @author Administrator
 *
 */
@Entity
@Table(name = "t_distributor_rate")
public class DistributorRate {

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "distributor_rate_id", length = 36)
	public long id;
	/**
	 * 渠道商
	 */
	@ManyToOne(targetEntity = Distributor.class, cascade = {})
	@JoinColumn(name = "distributor_id", foreignKey = @ForeignKey(name = "none"))
	// @JsonIgnore
	public Distributor distributor;

	/**
	 * 类型(如：微信，支付宝)
	 */
	@Column(name = "`type`", length = 20)
	@Enumerated(EnumType.STRING)
	public PayType type;

	/**
	 * 费率(%)
	 */
	@Column(name = "rate")
	public Double rate;

	/**
	 * 固定手续费(分)
	 */
	@Column(name = "money")
	public Long money;

	/**
	 * 上限手续费(分)
	 */
	@Column(name = "`limit`")
	public Long limit;

	/**
	 * 下限手续费(分)
	 */
	@Column(name = "`minimum`")
	public Long minimum;
	
}
